<?php

/*
	采用第三方评论系统 弃
*/
// use yii\widgets\LinkPager;
// foreach ($comment as $value) { 
// 	echo $value['nickname'],"说:",$value['content'];
// }
// 	echo LinkPager::widget([
//     	'pagination' => $page,
//     	// 'maxButtonCount' => 2,
// 	]);
$this->params['breadcrumbs']['/article'] = '文章';
$this->params['breadcrumbs']['/article/'.$_GET['catSlug'].'/'] = findTextFromSlug($_GET['catSlug'],'cat_name');
$this->params['breadcrumbs'][] = $data['title'];
$this->params['active'] = 'article';
$this->title = $data['title'];
$statusName = Yii::$app->params['status_name'];
$this->params['active'] = 'article';
?>
<div class="am-u-md-9">
	<h2><?=$data['title']?></h2>
	<div class="am-alert am-alert-secondary" data-am-alert>
		本文发布时间为：<?=date('y-m-d H:i',$data['news_time'])?> ， 最后修改时间为：<?=date('y-m-d H:i',$data['modify_time'])?> , 当前状态为 <span style="color:#c00"><?=$statusName[$data['status']]?></span>
	</div>
	<article>
		<?=$data['describe']?>
	</article>
	<?php if($data['status'] == 2) : ?>
		<p>(完)</p>
	<?php else : ?>
	<div class="am-alert am-alert-secondary" data-am-alert>
		当前文章尙在 <span style="color:#c00"><?=$statusName[$data['status']]?></span> 中，更新有惊喜，不要走开哦~
	</div>
	<?php endif; ?>
	<!-- 
	采用第三方评论系统 原评论入口弃
 	-->
 	<hr>
 	<?php if($data['allow_comment']) : ?>
	<div id="SOHUCS" sid="<?=$data['id']?>" ></div>
	<?php else: ?>
	<blockquote>
  		<p>很抱歉，评论被作者关闭了=- =</p>
	</blockquote>
	<?php endif; ?>
</div>
<?= $this->render('/layouts/sidebar') ?>

<?php $this->beginBlock('js'); ?>
<script type="text/javascript" src="/assets/ueditor/third-party/SyntaxHighlighter/shCore.js"></script>
<script type="text/javascript" src="/js/hl.js"></script>
<script type="text/javascript">
	SyntaxHighlighter.all();
	<!--PC和WAP自适应版-->
	<?php if($data['allow_comment']) : ?>
	(function(){ 
		var appid = 'cysNnsNMt'; 
		var conf = 'prod_7b68fdc9afd3e266fb5d24c881992b43'; 
		var width = window.innerWidth || document.documentElement.clientWidth; 
		if (width < 960) { 
			window.document.write('<script id="changyan_mobile_js" charset="utf-8" type="text/javascript" src="http://changyan.sohu.com/upload/mobile/wap-js/changyan_mobile.js?client_id=' + appid + '&conf=' + conf + '"><\/script>');
		}else{ 
			var loadJs=function(d,a){
					var c=document.getElementsByTagName("head")[0]||document.head||document.documentElement;
					var b=document.createElement("script");
					b.setAttribute("type","text/javascript");
					b.setAttribute("charset","UTF-8");
					b.setAttribute("src",d);
					if(typeof a==="function"){
						if(window.attachEvent){
							b.onreadystatechange=function(){
								var e=b.readyState;
								if(e==="loaded"||e==="complete"){
									b.onreadystatechange=null;a()
								}
							}
						}else{
							b.onload=a
						}
					}
					c.appendChild(b)
			};
			loadJs("http://changyan.sohu.com/upload/changyan.js",function(){
				window.changyan.api.config({appid:appid,conf:conf})
			}); 
		}
	})();
	<?php endif; ?>
</script>
<?php $this->endBlock(); ?>
<?php $this->beginBlock('css'); ?>
<link rel="stylesheet" type="text/css" href="/assets/ueditor/third-party/SyntaxHighlighter/shCoreDefault.css">
<?php $this->endBlock(); ?>